package com.chocus.core.service.buyer;

import com.chocus.core.bean.BuyerCart;
import com.chocus.core.bean.BuyerItem;
import com.chocus.core.bean.order.Order;
import com.chocus.core.bean.product.Sku;
import com.chocus.core.bean.user.Buyer;

public interface BuyerService {
	/**
	 * 通过用户名查询用户
	 * 
	 * @param username
	 * @return
	 */
	public Buyer getBuyerByUsername(String username);

	/**
	 * 将购物车商品保存到redis
	 * 
	 * @param buyerCart
	 * @param username
	 */
	public void addBuyerCartToRedis(BuyerCart buyerCart, String username);

	/**
	 * 从redis中获取购物车对象
	 * 
	 * @param username
	 * @return
	 */
	public BuyerCart getBuyerCartFromRedis(String username);

	/**
	 * 向购物车中填充数据
	 * 
	 * @param buyerCart
	 */
	public Sku putDataToBuyerCart(BuyerItem buyerItem);
	
	/**
	 * 保存订单及订单详情并清空购物车
	 * 
	 * @param order
	 * @param username
	 */
	public void saveOrder(Order order, String username);
	
}
